import {
	createSSRApp
} from "vue";
import App from "./App.vue";
import { Button, Checkbox, CheckboxGroup, 
	NumberKeyboard, Image as VanImage, Icon, 
	NavBar, Col, Row, ActionSheet, Field, Uploader, Tabbar, 
	TabbarItem, PullRefresh, List, TextEllipsis,
	SwipeCell,Badge,Cell, CellGroup,Grid, GridItem, Dialog, ImagePreview, Popup, Toast,DatePicker,Picker, Tab, Tabs,Swipe, SwipeItem,Space,Switch    } from 'vant';

import { get, post, del, put, patch } from '@/utils/requst.js';
import AuthPup from "@/components/authPup/index.vue"
import Attestation from "@/components/authPup/components/attestation.vue" // 实名认证
import OpenMember from "@/components/authPup/components/openMember.vue" // 开通会员
import UnlockAccount from "@/components/authPup/components/unlockAccount.vue" // 社交账号
import Empty from "@/components/empty" // 社交账号
import ActionSheetBox from "@/components/actionSheet/index.vue"
import UploadImg from "@/components/uploadImg/index.vue"
import Ident from "@/pages/home/components/ident/index.vue"
import AuthRole from "@/pages/home/components/authRole/index.vue"
import Attention from '@/components/attention/index.vue'
import RealAuth from '@/components/realAuth/index.vue'
import RealSexAuth from '@/components/realSexAuth/index.vue'
import HeadImg from '@/components/headImg/index.vue'
import SexMain from '@/components/sexMain/index.vue'
import ImageView from '@/components/imageView/index.vue'
// import VueAMap, {initAMapApiLoader} from '@vuemap/vue-amap';
// import '@vuemap/vue-amap/dist/style.css'
// initAMapApiLoader({
//   key: 'a37ca0f8366b4ec84e39dda7a6fbbac6',
//   securityJsCode: 'b0942f45a67067755567b98b06d223cf', // 新版key需要配合安全密钥使用
//   //Loca:{
//   //  version: '2.0.0'
//   //} // 如果需要使用loca组件库，需要加载Loca
// })

import 'vant/lib/index.css';
import '@/assets/css/vant-theme.css'
import '@/assets/css/style.scss' // 公共样式
import "@/permission/index"
import * as Pinia from 'pinia';
//页面中调用方法
import { createPinia } from 'pinia'
import "@/permission/index.js"
export function createApp() {
	const app = createSSRApp(App);
	const pinia  = createPinia();
	// app.use(VueAMap)
	app.use(pinia)
	app.use(Button);
	app.use(Checkbox);
	app.use(CheckboxGroup);
	app.use(NumberKeyboard);
	app.use(VanImage)
	app.use(Icon)
	app.use(NavBar)
	app.use(Col)
	app.use(Row)
	app.use(ActionSheet)
	app.use(Field)
	app.use(Uploader)
	app.use(Tabbar);
	app.use(TabbarItem);
	app.use(PullRefresh);
	app.use(List); 
	app.use(TextEllipsis);  
	app.use(SwipeCell); 
	app.use(Badge)
	app.use(Cell);
	app.use(CellGroup);
	app.use(Grid);
	app.use(GridItem); 
	app.use(Dialog);  
	app.use(Popup);  
	app.use(Toast); 
	app.use(DatePicker);  
	app.use(Picker);   
	app.use(Pinia);
	app.use(Tab);
	app.use(Swipe);
	app.use(SwipeItem);
	app.use(ImagePreview);
	app.use(Space);
	app.use(Tabs); 
	app.use(Switch); 
	app.component("AuthPup",AuthPup);
	app.component("Attestation",Attestation);
	app.component("OpenMember",OpenMember);
	app.component("UnlockAccount",UnlockAccount);
	app.component("Empty",Empty);
	app.component("ActionSheetBox",ActionSheetBox);
	app.component("UploadImg",UploadImg);
	app.component("Ident",Ident);
	app.component("AuthRole",AuthRole);
	app.component("Attention",Attention);
	app.component("RealAuth",RealAuth);	
	app.component("RealSexAuth",RealSexAuth);	
	app.component("HeadImg",HeadImg);	
	app.component("SexMain",SexMain);	
	app.component("ImageView",ImageView);	
	app.config.globalProperties.$get = get
	app.config.globalProperties.$post = post
	app.config.globalProperties.$del = del
	app.config.globalProperties.$put = put
	app.config.globalProperties.$patch = patch
	return {
		app
	};
}
